import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { type PageTitleConfig } from "./types";

// 获取首页标题内容
export const getIndexInfo = (params: {
  id: string | number;
}): AxiosPromise<PageTitleConfig> => {
  return request({
    method: "get",
    url: `/api/index/info/id/${params.id}`,
    params,
  });
};

// 修改首页标题内容
export const editIndexInfo = (
  id: string | number,
  data: any
): AxiosPromise<any> => {
  return request({
    method: "post",
    url: `api/index/edit/id/${id}`,
    data,
  });
};
